 /* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.





Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/


#import <Foundation/Foundation.h>
#import <JDCloudOCSDKHttpdns/HttpdnsModel.h>

@implementation Domain
-(id) initWithId:(NSNumber*) idValue
      accountId:(NSString*)accountId
      domainName:(NSString*)domainName
      createTime:(NSNumber*)createTime
      queryCount:(NSNumber*)queryCount
      isDelete:(NSNumber*)isDelete { 
     self.idValue = idValue;               
     self.accountId = accountId;               
     self.domainName = domainName;               
     self.createTime = createTime;               
     self.queryCount = queryCount;               
     self.isDelete = isDelete;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self idValue])
    {
        [result setValue:[self idValue] forKey:@"id"];
    }
    if([self accountId])
    {
        [result setValue:[self accountId] forKey:@"accountId"];
    }
    if([self domainName])
    {
        [result setValue:[self domainName] forKey:@"domainName"];
    }
    if([self createTime])
    {
        [result setValue:[self createTime] forKey:@"createTime"];
    }
    if([self queryCount])
    {
        [result setValue:[self queryCount] forKey:@"queryCount"];
    }
    if([self isDelete])
    {
        [result setValue:[self isDelete] forKey:@"isDelete"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.idValue = [dictionary objectForKey:@"id"];
    self.accountId = [dictionary objectForKey:@"accountId"];
    self.domainName = [dictionary objectForKey:@"domainName"];
    self.createTime = [dictionary objectForKey:@"createTime"];
    self.queryCount = [dictionary objectForKey:@"queryCount"];
    self.isDelete = [dictionary objectForKey:@"isDelete"];
    return self;
}
 @end
@implementation Count
-(id) initWithName:(NSString*) name
      data:(NSArray<NSNumber*>*)data { 
     self.name = name;               
     self.data = data;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self name])
    {
        [result setValue:[self name] forKey:@"name"];
    }
    if([self data])
    {
        [result setValue:[self data] forKey:@"data"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.name = [dictionary objectForKey:@"name"];
    self.data = [dictionary objectForKey:@"data"];
    return self;
}
 @end
@implementation Totalcount
-(id) initWithDomain:(NSString*) domain
      count:(NSNumber*)count { 
     self.domain = domain;               
     self.count = count;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self domain])
    {
        [result setValue:[self domain] forKey:@"domain"];
    }
    if([self count])
    {
        [result setValue:[self count] forKey:@"count"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.domain = [dictionary objectForKey:@"domain"];
    self.count = [dictionary objectForKey:@"count"];
    return self;
}
 @end
@implementation Dataplan
-(id) initWithId:(NSNumber*) idValue
      accountId:(NSString*)accountId
      number:(NSNumber*)number
      unit:(NSNumber*)unit
      startTime:(NSNumber*)startTime
      expireTime:(NSNumber*)expireTime
      usedNumber:(NSNumber*)usedNumber
      type:(NSNumber*)type
      isExpired:(NSNumber*)isExpired { 
     self.idValue = idValue;               
     self.accountId = accountId;               
     self.number = number;               
     self.unit = unit;               
     self.startTime = startTime;               
     self.expireTime = expireTime;               
     self.usedNumber = usedNumber;               
     self.type = type;               
     self.isExpired = isExpired;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self idValue])
    {
        [result setValue:[self idValue] forKey:@"id"];
    }
    if([self accountId])
    {
        [result setValue:[self accountId] forKey:@"accountId"];
    }
    if([self number])
    {
        [result setValue:[self number] forKey:@"number"];
    }
    if([self unit])
    {
        [result setValue:[self unit] forKey:@"unit"];
    }
    if([self startTime])
    {
        [result setValue:[self startTime] forKey:@"startTime"];
    }
    if([self expireTime])
    {
        [result setValue:[self expireTime] forKey:@"expireTime"];
    }
    if([self usedNumber])
    {
        [result setValue:[self usedNumber] forKey:@"usedNumber"];
    }
    if([self type])
    {
        [result setValue:[self type] forKey:@"type"];
    }
    if([self isExpired])
    {
        [result setValue:[self isExpired] forKey:@"isExpired"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.idValue = [dictionary objectForKey:@"id"];
    self.accountId = [dictionary objectForKey:@"accountId"];
    self.number = [dictionary objectForKey:@"number"];
    self.unit = [dictionary objectForKey:@"unit"];
    self.startTime = [dictionary objectForKey:@"startTime"];
    self.expireTime = [dictionary objectForKey:@"expireTime"];
    self.usedNumber = [dictionary objectForKey:@"usedNumber"];
    self.type = [dictionary objectForKey:@"type"];
    self.isExpired = [dictionary objectForKey:@"isExpired"];
    return self;
}
 @end
@implementation DataplanInfo
-(id) initWithUsedNumber:(NSNumber*) usedNumber
      excessNumber:(NSNumber*)excessNumber { 
     self.usedNumber = usedNumber;               
     self.excessNumber = excessNumber;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self usedNumber])
    {
        [result setValue:[self usedNumber] forKey:@"usedNumber"];
    }
    if([self excessNumber])
    {
        [result setValue:[self excessNumber] forKey:@"excessNumber"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.usedNumber = [dictionary objectForKey:@"usedNumber"];
    self.excessNumber = [dictionary objectForKey:@"excessNumber"];
    return self;
}
 @end
@implementation AccountId
-(id) initWithUserPin:(NSString*) userPin
      accountIdValue:(NSString*)accountIdValue { 
     self.userPin = userPin;               
     self.accountIdValue = accountIdValue;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self userPin])
    {
        [result setValue:[self userPin] forKey:@"userPin"];
    }
    if([self accountIdValue])
    {
        [result setValue:[self accountIdValue] forKey:@"accountId"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.userPin = [dictionary objectForKey:@"userPin"];
    self.accountIdValue = [dictionary objectForKey:@"accountId"];
    return self;
}
 @end
@implementation Account
-(id) initWithId:(NSNumber*) idValue
      userPin:(NSString*)userPin
      accountId:(NSString*)accountId
      serviceIp:(NSArray<NSString*>*)serviceIp
      key:(NSArray<NSString*>*)key
      keyStatus:(NSArray<NSNumber*>*)keyStatus
      createTime:(NSNumber*)createTime
      updateTime:(NSNumber*)updateTime
      noauthAccess:(NSNumber*)noauthAccess
      domainLimit:(NSNumber*)domainLimit
      accountStatus:(NSNumber*)accountStatus { 
     self.idValue = idValue;               
     self.userPin = userPin;               
     self.accountId = accountId;               
     self.serviceIp = serviceIp;               
     self.key = key;               
     self.keyStatus = keyStatus;               
     self.createTime = createTime;               
     self.updateTime = updateTime;               
     self.noauthAccess = noauthAccess;               
     self.domainLimit = domainLimit;               
     self.accountStatus = accountStatus;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self idValue])
    {
        [result setValue:[self idValue] forKey:@"id"];
    }
    if([self userPin])
    {
        [result setValue:[self userPin] forKey:@"userPin"];
    }
    if([self accountId])
    {
        [result setValue:[self accountId] forKey:@"accountId"];
    }
    if([self serviceIp])
    {
        [result setValue:[self serviceIp] forKey:@"serviceIp"];
    }
    if([self key])
    {
        [result setValue:[self key] forKey:@"key"];
    }
    if([self keyStatus])
    {
        [result setValue:[self keyStatus] forKey:@"keyStatus"];
    }
    if([self createTime])
    {
        [result setValue:[self createTime] forKey:@"createTime"];
    }
    if([self updateTime])
    {
        [result setValue:[self updateTime] forKey:@"updateTime"];
    }
    if([self noauthAccess])
    {
        [result setValue:[self noauthAccess] forKey:@"noauthAccess"];
    }
    if([self domainLimit])
    {
        [result setValue:[self domainLimit] forKey:@"domainLimit"];
    }
    if([self accountStatus])
    {
        [result setValue:[self accountStatus] forKey:@"accountStatus"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.idValue = [dictionary objectForKey:@"id"];
    self.userPin = [dictionary objectForKey:@"userPin"];
    self.accountId = [dictionary objectForKey:@"accountId"];
    self.serviceIp = [dictionary objectForKey:@"serviceIp"];
    self.key = [dictionary objectForKey:@"key"];
    self.keyStatus = [dictionary objectForKey:@"keyStatus"];
    self.createTime = [dictionary objectForKey:@"createTime"];
    self.updateTime = [dictionary objectForKey:@"updateTime"];
    self.noauthAccess = [dictionary objectForKey:@"noauthAccess"];
    self.domainLimit = [dictionary objectForKey:@"domainLimit"];
    self.accountStatus = [dictionary objectForKey:@"accountStatus"];
    return self;
}
 @end
@implementation CountData
-(id) initWithTime:(NSArray<NSNumber*>*) time
      count:(NSArray<Count*>*)count { 
     self.time = time;               
     self.count = count;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self time])
    {
        [result setValue:[self time] forKey:@"time"];
    }
    if([self count])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self count] count]; i++) {
            Count* item = [[self count] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"count"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.time = [dictionary objectForKey:@"time"];
    NSArray* countArray = [dictionary objectForKey:@"count"];
    if(countArray&&![countArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [countArray count];i++)
        {
            Count* item = [[Count alloc]initWithDic:[countArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.count = propertyArray;
    }
    return self;
}
 @end
@implementation DomainData
-(id) initWithDataList:(NSArray<Domain*>*) dataList
      currentCount:(NSNumber*)currentCount
      totalCount:(NSNumber*)totalCount
      totalPage:(NSNumber*)totalPage { 
     self.dataList = dataList;               
     self.currentCount = currentCount;               
     self.totalCount = totalCount;               
     self.totalPage = totalPage;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self dataList])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self dataList] count]; i++) {
            Domain* item = [[self dataList] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"dataList"];
    }
    if([self currentCount])
    {
        [result setValue:[self currentCount] forKey:@"currentCount"];
    }
    if([self totalCount])
    {
        [result setValue:[self totalCount] forKey:@"totalCount"];
    }
    if([self totalPage])
    {
        [result setValue:[self totalPage] forKey:@"totalPage"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* dataListArray = [dictionary objectForKey:@"dataList"];
    if(dataListArray&&![dataListArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [dataListArray count];i++)
        {
            Domain* item = [[Domain alloc]initWithDic:[dataListArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.dataList = propertyArray;
    }
    self.currentCount = [dictionary objectForKey:@"currentCount"];
    self.totalCount = [dictionary objectForKey:@"totalCount"];
    self.totalPage = [dictionary objectForKey:@"totalPage"];
    return self;
}
 @end
@implementation TotalcountData
-(id) initWithDataList:(NSArray<Totalcount*>*) dataList
      currentCount:(NSNumber*)currentCount
      totalCount:(NSNumber*)totalCount
      totalPage:(NSNumber*)totalPage { 
     self.dataList = dataList;               
     self.currentCount = currentCount;               
     self.totalCount = totalCount;               
     self.totalPage = totalPage;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self dataList])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self dataList] count]; i++) {
            Totalcount* item = [[self dataList] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"dataList"];
    }
    if([self currentCount])
    {
        [result setValue:[self currentCount] forKey:@"currentCount"];
    }
    if([self totalCount])
    {
        [result setValue:[self totalCount] forKey:@"totalCount"];
    }
    if([self totalPage])
    {
        [result setValue:[self totalPage] forKey:@"totalPage"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* dataListArray = [dictionary objectForKey:@"dataList"];
    if(dataListArray&&![dataListArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [dataListArray count];i++)
        {
            Totalcount* item = [[Totalcount alloc]initWithDic:[dataListArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.dataList = propertyArray;
    }
    self.currentCount = [dictionary objectForKey:@"currentCount"];
    self.totalCount = [dictionary objectForKey:@"totalCount"];
    self.totalPage = [dictionary objectForKey:@"totalPage"];
    return self;
}
 @end
 
 


